﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase

@if (DrawTooltip)
{
    <fluent-tooltip @ref=Element
                    class="@Class"
                    style="@Style"
                    visible="@Visible"
                    anchor="@Anchor"
                    delay="@Delay"
                    position="@Position.ToAttributeValue()"
                    auto-update-mode="@AutoUpdateMode"
                    horizontal-viewport-lock="@HorizontalViewportLock"
                    vertical-viewport-lock="@VerticalViewportLock"
                    role="tooltip"
                    @ontooltipdismiss="HandleDismissed"
                    @attributes="AdditionalAttributes">
        @if (string.IsNullOrWhiteSpace(MaxWidth ?? GlobalOptions?.MaxWidth))
        {
            @ChildContent
        }
        else
        {
            <div style="max-width: @(MaxWidth ?? GlobalOptions?.MaxWidth); text-wrap: wrap;">@ChildContent</div>
        }
    </fluent-tooltip>
}
